<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <title>
      Pomelo
    </title>
    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <meta http-equiv="content-style-type" content="text/css" />
    <meta http-equiv="content-scripte-type" content="text/javascript" />
    <meta name="author" content="netease" />
    <meta name="version" content="1.0" />
    <meta name="keywords" content="pomelo" />
    <link type="text/css" rel="stylesheet" href="css/base.css" />
    <script src="js/lib/build/build.js" type="text/javascript"></script>
    <script type="text/javascript">
      require('boot');
    </script> 
    <script type="text/javascript">
      var pomelo = window.pomelo;
      var host = "127.0.0.1"; //本地服务器
      // host = "120.77.157.99"     //热更新服务器
      //host = "39.108.225.227"      //欢乐赢棋牌服务器
      //host = "39.108.139.132"      //CentOs服务器
      //host = "nnapi.5d8d.com"; //我爱牛牛服务器
      // host = "119.23.216.86"
      // host = "pdkgame.5d8d.com"
      // host = "yy.njhuajia.com"
      var port = "3910";
      function show() {
          pomelo.request("connector.entryHandler.getNotify",null, function(data) {
              console.log(data)
          });
      }
      pomelo.on("onMessage",function(data) {
        console.log("onMessage")
        console.log(data)
      })
      pomelo.on("onNotify",function(data) {
        console.log("onNotify")
        console.log(data)
      })
      pomelo.on("disconnect",function(data) {
        // body...
        console.log("disconnect")
      })
      pomelo.on("close",function(data) {
        console.log("close")
      })
      pomelo.on("heartbeat timeout",function(data) {
        // body...
        console.log("heartbeat timeout")
      })
      pomelo.on("io-error",function(data) {
        // body...
        console.log("io-error")
        console.log(data)
      })

      //获取app登录信息
      var getAppLoginInfo = function() {
          pomelo.request("connector.award.getAppLoginInfo", {}, function(data) {
              console.log(data)
            }
          )
      }
      //获取app登录奖励
      var getAppLoginAward = function() {
          pomelo.request("connector.award.getAppLoginAward", {}, function(data) {
              console.log(data)
            }
          )
      }



      //====================================提现====================================//
      var applyWithdrawal = function(value) {
          pomelo.request("connector.award.applyWithdrawal", {value : value}, function(data) {
              console.log(data)
            }
          )
      }
      //====================================邀请宝箱====================================//
      //获取邀请信息
      var getInviteInfo = function() {
          pomelo.request("connector.award.getInviteInfo", {}, function(data) {
              console.log(data)
            }
          )
      }
      //领取邀请宝箱
      var getInviteAward = function(boxId) {
          pomelo.request("connector.award.getInviteAward", {boxId : boxId}, function(data) {
              console.log(data)
            }
          )
      }
      //===================================道具背包=================================//
      var getBag = function() {
          pomelo.request("connector.bag.getBag", {}, function(data) {
              console.log(data)
            }
          )
      }
      var useItem = function(itemId) {
          pomelo.request("connector.bag.useItem", {itemId : itemId}, function(data) {
              console.log(data)
            }
          )
      }
      //===================================商城相关=================================//
      //购买商品
      var buyGoods = function(goodsId) {
          pomelo.request("connector.shop.buyGoods", {goodsId : goodsId}, function(data) {
              console.log(data)
            }
          )
      }
      //获取购买信息(月卡、礼包等)
      var getMonthCardInfo = function() {
          pomelo.request("connector.shop.getMonthCardInfo", {}, function(data) {
              console.log(data)
            }
          )
      }
      //领取月卡奖励
      var getMonthCardAward = function(monthCardType) {
          pomelo.request("connector.shop.getMonthCardAward", {monthCardType : monthCardType}, function(data) {
              console.log(data)
            }
          )
      }
      //获取礼包信息
      var getGiftBagInfo = function() {
          pomelo.request("connector.shop.getGiftBagInfo", {}, function(data) {
              console.log(data)
            }
          )
      }
      //===================================邮件相关=================================//
      //获取邮件列表
      var getMailList = function() {
          pomelo.request("connector.mail.getMailList", {}, function(data) {
              console.log(data)
            }
          )
      }
      //领取邮件奖励
      var getMailAward = function(mailId) {
          pomelo.request("connector.mail.getMailAward", {mailId : mailId}, function(data) {
              console.log(data)
            }
          )
      }
      //读邮件
      var readMail = function(mailId) {
          pomelo.request("connector.mail.readMail", {mailId : mailId}, function(data) {
              console.log(data)
            }
          )
      }
      //删除邮件
      var deletedMail = function(mailId) {
          pomelo.request("connector.mail.deletedMail", {mailId : mailId}, function(data) {
              console.log(data)
            }
          )
      }
      //清空已读
      var deletedUseless = function() {
          pomelo.request("connector.mail.deletedUseless", {}, function(data) {
              console.log(data)
            }
          )
      }
      //一键领取
      var getAllMail = function() {
          pomelo.request("connector.mail.getAllMail", {}, function(data) {
              console.log(data)
            }
          )
      }
      //===================================任务相关=================================//
      //领取红包任务奖励
      var getRedTaskAward = function() {
          pomelo.request("connector.task.getRedTaskAward", {}, function(data) {
              console.log(data)
            }
          )
      }
      //刷新红包任务
      var refreshRedTask = function() {
          pomelo.request("connector.task.refreshRedTask", {}, function(data) {
              console.log(data)
            }
          )
      }
      //获取任务信息
      var getTaskInfo = function() {
          pomelo.request("connector.task.getTaskInfo", {}, function(data) {
              console.log(data)
            }
          )
      }

      //领取任务奖励
      var getTaskAward = function(taskId) {
          pomelo.request("connector.task.getTaskAward", {taskId : taskId}, function(data) {
              console.log(data)
            }
          )
      }
      //====================================管理员相关=====================================//
      var admin_getRoomList = function() {
          pomelo.request("connector.admin.getRoomList", {}, function(data) {
              console.log(data)
            }
          )
      }
      var admin_getRoomInfo = function(roomId) {
          pomelo.request("connector.admin.getRoomInfo", {roomId : roomId}, function(data) {
              console.log(data)
            }
          )
      }
      var admin_getOnlineUser = function() {
          pomelo.request("connector.admin.getOnlineUser", {}, function(data) {
              console.log(data)
            }
          )
      }
      var admin_setMaintainFlag = function(flag) {
          pomelo.request("connector.admin.setMaintainFlag", {flag: flag}, function(data) {
              console.log(data)
            }
          )
      }
      var admin_getCompetitionAll = function() {
          pomelo.request("connector.admin.getCompetitionAll", {}, function(data) {
              console.log(data)
            }
          )
      }
      var admin_getCompetitionInfoByNumeration = function(numeration) {
          pomelo.request("connector.admin.getCompetitionInfoByNumeration", {numeration : numeration}, function(data) {
              console.log(data)
            }
          )
      }
      //获取比赛场库存
      var admin_getCompetitionInventory = function() {
          pomelo.request("connector.admin.getCompetitionInventory", {}, function(data) {
              console.log(data)
            }
          )
      }
      //设置比赛场库存
      var admin_setCompetitionInventory = function(cid,value) {
          pomelo.request("connector.admin.setCompetitionInventory", {cid : cid,value : value}, function(data) {
              console.log(data)
            }
          )
      }
      //获取金币场库存
      var admin_getGoldInventory = function() {
          pomelo.request("connector.admin.getGoldInventory", {}, function(data) {
              console.log(data)
            }
          )
      }
      //设置金币场库存
      var admin_setGoldInventory = function(rid,value) {
          pomelo.request("connector.admin.setGoldInventory", {rid : rid,value : value}, function(data) {
              console.log(data)
            }
          )
      }
      //获取玩家背包
      var admin_getBag = function(uid) {
          pomelo.request("connector.admin.getBag", {uid : uid}, function(data) {
              console.log(data)
            }
          )
      }
      //改变玩家背包物品
      var admin_changeBag = function(uid,itemId,value) {
          pomelo.request("connector.admin.changeBag", {uid : uid,itemId : itemId,value : value}, function(data) {
              console.log(data)
            }
          )
      }
      //根据手机号获取UID
      var admin_getPhoneByUid = function(phone) {
          pomelo.request("connector.admin.getPhoneByUid", {phone : phone}, function(data) {
              console.log(data)
            }
          )
      }
      //获取签到奖励
      var getLoginAward = function() {
          pomelo.request("connector.award.getLoginAward", {}, function(data) {
              console.log(data)
            }
          )
      }
      //获取签到信息
      var getLoginInfo = function() {
          pomelo.request("connector.award.getLoginInfo", {}, function(data) {
              console.log(data)
            }
          )
      }
      //获取金币场内玩家数量列表
      var getGoldMatchPlyerCounts = function() {
          pomelo.request("connector.match.getGoldMatchPlyerCounts", {}, function(data) {
              console.log(data)
            }
          )
      }
      //报名比赛场
      var signUp = function(cid) {
          pomelo.request("connector.match.signUp", {cid : cid}, function(data) {
              console.log(data)
            }
          )
      }
      //取消报名
      var cancelSignUp = function() {
          pomelo.request("connector.match.cancelSignUp", {}, function(data) {
              console.log(data)
            }
          )
      }
      //获取免费场参与次数
      var getFreePlayCount = function() {
          pomelo.request("connector.match.getFreePlayCount", {}, function(data) {
              console.log(data)
            }
          )
      }
      //获取我的比赛场信息
      var getCompetitionInfo = function() {
          pomelo.request("connector.match.getCompetitionInfo", {}, function(data) {
              console.log(data)
            }
          )
      }
      //获取比赛场报名人数
      var getCompetitionList = function() {
          pomelo.request("connector.match.getCompetitionList", {}, function(data) {
              console.log(data)
            }
          )
      }
      //获取比赛场战绩
      var getRunCHistory = function() {
          pomelo.request("connector.match.getRunCHistory", {}, function(data) {
              console.log(data)
            }
          )
      }
      //获取战绩
      var getHistory = function() {
          pomelo.request("connector.hunanRunQuickly.getHistory", {}, function(data) {
              console.log(data)
            }
          )
      }
      //获取解散信息
      var getDissolutionInfo = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "getDissolutionInfo","params" : {}}, function(data) {
              console.log(data)
            }
          )
      }
      //发起解散
      var dissolution = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "dissolution","params" : {}}, function(data) {
              console.log(data)
            }
          )
      }
      //同意解散
      var agreeDissolve = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "agreeDissolve","params" : {}}, function(data) {
              console.log(data)
            }
          )
      }
      //拒绝解散
      var refuseDissolve = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "refuseDissolve","params" : {}}, function(data) {
              console.log(data)
            }
          )
      }
      //出牌
      var playCard = function(index,col) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "playCard","params" : {index : index,col : col}}, function(data) {
              console.log(data)
            }
          )
      }
      //出牌
      var playCard = function(index,col) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "playCard","params" : {index : index,col : col}}, function(data) {
              console.log(data)
            }
          )
      }

      var code2accessToken = function(code) {
          pomelo.request("connector.entryHandler.code2accessToken", {code : code}, function(data) {
              console.log(data)
            }
          )
      }
      var wxgameEnter = function(openId,session_key,userInfo) {
        pomelo.request("connector.entryHandler.wxgameEnter", {openId : openId,session_key : session_key,userInfo : userInfo}, function(data) {
            console.log(data)
          }
        )
      }
      //获取新手七日奖信息
      var getNewPlayerRedInfo = function() {
          pomelo.request("connector.award.getNewPlayerRedInfo", {}, function(data) {
              console.log(data)
            }
          )
      }
      //领取每日新手七日奖
      var getNewPlayerRedDay = function() {
          pomelo.request("connector.award.getNewPlayerRedDay", {}, function(data) {
              console.log(data)
            }
          )
      }
      //领取新手七日奖最终红包
      var getNewPlayerRedAward = function() {
          pomelo.request("connector.award.getNewPlayerRedAward", {}, function(data) {
              console.log(data)
            }
          )
      }

      //领取闯关红包
      var getCheckpointRed = function(checkpoint) {
          pomelo.request("connector.hunanRunQuickly.getCheckpointRed", {checkpoint : checkpoint}, function(data) {
              console.log(data)
            }
          )
      }
      //领取闯关分享红包
      var getShareCheckpointRed = function(checkpoint,itemId,value) {
          pomelo.request("connector.hunanRunQuickly.getShareCheckpointRed", {checkpoint : checkpoint,itemId : itemId,value : value}, function(data) {
              console.log(data)
            }
          )
      }
      //获取闯关数据
      var getCheckpointInfo = function() {
          pomelo.request("connector.hunanRunQuickly.getCheckpointInfo", {}, function(data) {
              console.log(data)
            }
          )
      }
      //获取闯关排行榜
      var getCheckpointRanking = function() {
          pomelo.request("connector.hunanRunQuickly.getCheckpointRanking", {}, function(data) {
              console.log(data)
            }
          )
      }
      //获取闯关排行榜历史记录
      var getCheckpointHistory = function(dayStr) {
          pomelo.request("connector.hunanRunQuickly.getCheckpointHistory", {dayStr : dayStr}, function(data) {
              console.log(data)
            }
          )
      }
      //加入金币匹配
      var joinGoldMatching = function() {
            pomelo.request("connector.match.joinMatching", {type : "run_1"}, function(data) {
                console.log(data)
              }
            )
      }
      //加入闯关匹配
      var joinCheckpointMatching = function() {
            pomelo.request("connector.match.joinMatching", {type : "hunanRunQuicklyCheckpoint"}, function(data) {
                console.log(data)
              }
            )
      }
      //加入普通匹配
      var joinNormalMatching = function() {
          pomelo.request("connector.match.joinMatching", {type : "hunanRunQuickly"}, function(data) {
              console.log(data)
            }
          )
      }
      //离开匹配
      var leaveMatching = function() {
          pomelo.request("connector.match.leaveMatching", {}, function(data) {
              console.log(data)
            }
          )
      }
      //聊天
      var say = function(msg) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "say","params" : {msg : msg}}, function(data) {
              console.log(data)
            }
          )
      }
      //准备
      var ready = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "ready","params" : {}}, function(data) {
              console.log(data)
            }
          )
      }
      //出牌
      var playCard = function(index,col) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "playCard","params" : {index : index,col : col}}, function(data) {
              console.log(data)
            }
          )
      }
      //获取答题历史信息
      var getAnswerHistory = function(dayStr) {
          pomelo.request("connector.gameInfo.getAnswerHistory", {dayStr : dayStr}, function(data) {
              console.log(data)
            }
          )
      }
      //获取答题游戏信息
      var getAnswerInfo = function() {
          pomelo.request("connector.gameInfo.getAnswerInfo", {}, function(data) {
              console.log(data)
            }
          )
      }
      //获取账号信息
      var getAccountInfo = function() {
          pomelo.request("connector.gameInfo.getAccountInfo", {}, function(data) {
              console.log(data)
            }
          )
      }
      //开始游戏
      var gameBegin = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "gameBegin","params" : {}}, function(data) {
              console.log(data)
            }
          )
      }
      //获取当前房间信息
      var getRoomInfo = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "getRoomInfo","params" : {}}, function(data) {
              console.log(data)
            }
          )
      }
      //提交答案
      var submit = function(answer) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "submit","params" : {answer : answer}}, function(data) {
              console.log(data)
            }
          )
      }
      //放弃游戏
      var giveUp = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "giveUp","params" : {}}, function(data) {
              console.log(data)
            }
          )
      }
      //复活
      var resurgence = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "resurgence","params" : {}}, function(data) {
              console.log(data)
            }
          )
      }
      //增加复活次数
      var addLife = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "addLife","params" : {}}, function(data) {
              console.log(data)
            }
          )
      }
      //获取复活次数
      var getLife = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "getLife","params" : {}}, function(data) {
              console.log(data)
            }
          )
      }
      var send = function(code,msg) {
          pomelo.request("connector.entryHandler.sendData", {"code" : code,"params" : msg}, function(data) {
              console.log(data)
            }
          );
      }

      //申请绑定验证码
      var sendCaptcha = function(phone) {
          pomelo.request("connector.identity.sendCaptcha", {"phone" : phone}, function(data) {
              console.log("flag is : "+data.flag)
            }
          );
      }
      //提交验证码绑定手机
      var bindPhone = function(code,cardNo,realName) {
          pomelo.request("connector.identity.bindPhone", {"code" : code,"cardNo" : cardNo,"realName" : realName}, function(data) {
              console.log("flag is : "+data.flag)
            }
          );
      }
      //获取我绑定的手机
      var getPhoneInfo = function() {
          pomelo.request("connector.sms.getPhoneInfo", {}, function(data) {
              console.log(data)
            }
          );
      }
      //发送登陆验证码
      var sendLoginCaptcha = function(phone) {
          pomelo.request("connector.sms.sendLoginCaptcha", {phone : phone}, function(data) {
              console.log(data)
            }
          );
      }
      //提交登陆验证码
      var bindToken = function(phone,code) {
          pomelo.request("connector.sms.bindToken", {phone : phone,code : code}, function(data) {
              console.log(data)
            }
          );
      }

      //获取历史开奖记录
      var opencodeHistory = function(gameType) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "opencodeHistory",gameType : gameType,begin : 1,end : 10}}, function(data) {
              console.log(data)
            }
          );
      }

      //开启包厢CPGame  
      var openBalcony = function(uid) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "openBalcony",gameType : "CPGame",uid : uid}}, function(data) {
              console.log(data)
            }
          );
      }
      //获取卡单列表
      var getWaitLottryList = function(roomId) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "getWaitLottryList",roomId : roomId}}, function(data) {
              console.log(data)
            }
          );
      }
      //往期补单
      var supplement = function(type,expect,opencode) {
        var info = {
          type : type,
          expect : expect,
          opencode : opencode
        }
        pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "supplement",info : info}}, function(data) {
            console.log(data)
          }
        );
      }
      //手动开奖
      var manualLottry = function(type,expect,opencode) {
        var info = {
          type : type,
          expect : expect,
          opencode : opencode
        }
        pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "manualLottry",info : info}}, function(data) {
            console.log(data)
          }
        );
      }

      //管理员获取玩家绑定手机
      var m_getPhoneInfo = function(uid) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "getPhoneInfo",uid : uid}}, function(data) {
              console.log(data)
            }
          );
      }
      //管理员设置玩家绑定手机
      var m_setPhoneInfo = function(uid,phone) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "setPhoneInfo",uid : uid,phone : phone}}, function(data) {
              console.log(data)
            }
          );
      }
      var getUserStatistics = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "getUserStatistics","params" : {}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          );
      }
      var getRoomCurBet = function(gameType) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "getRoomCurBet","params" : {"gameType" : gameType}}, function(data) {
              data = data.flag
              var arr = []
              for(var i in data){
                for(var j in data[i]){
                  arr.push(data[i][j])
                }
              }
              arr.sort(function(a,b) {
                return a.time - b.time
              })
              arr = arr.slice(arr.length - 21 , arr.length - 1)
              console.log(arr)
            }
          )
      }
      //使用庄家接口获取机器人数据
      var MgetRobotData = function(roomId) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "useHouseOwnerCmd","code" : "getRobotData",roomId : roomId}}, function(data) {
              console.log(data)
            }
          );
      }
      //庄家获取机器人数据
      var getRobotData = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "houseOwnerCmd","params" : {"code" : "getRobotData"}}, function(data) {
              console.log(data)
            }
          );
      }
      //使用庄家接口设置机器人数据  data : [{"begin" : 0,"end" : 1440,"count" : 30,"power" : 1}]
      var MsetRobotData = function(roomId,gameType,data){
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "useHouseOwnerCmd","code" : "setRobotData",roomId : roomId,gameType : gameType,data : data}}, function(data) {
              console.log(data)
            }
          );
      }

      //设置豹子赔率
      var setBaoziType = function(baoziType,baoziPercent) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "setBaoziType","baoziType" : baoziType,"baoziPercent" : baoziPercent}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }

      //获取股东列表
      var getStockList = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "getStockList"}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      //获取股东积分
      var getStockScore = function(uid) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "getStockScore","uid" : uid}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      //设置股东积分
      var setStockScore = function(uid,score) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "setStockScore","uid" : uid,"score" : score}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      //获取股东积分改变记录
      var getStockScoreRecord = function(uid) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "getStockScoreRecord","uid" : uid}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      var updateNotify = function(notify) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "updateNotify","notify" : notify}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      var getUserInfo = function(uid) {
          pomelo.request("connector.entryHandler.getUserInfo", {"uid" : uid}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      var getDefaultLottry = function() {
          pomelo.request("connector.statistics.getDefaultLottry", {}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      var setDefaultLottry = function(data) {
          pomelo.request("connector.statistics.setDefaultLottry", {"data" : data}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      var getStatisticsResult = function(roomId,gameType,beginTime,endTime) {
          pomelo.request("connector.statistics.getStatisticsResult", {"roomId" : roomId,"gameType" : gameType,"beginTime" : beginTime,"endTime" : endTime}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      var getRecordResult = function(roomId,gameType,expect) {
          pomelo.request("connector.statistics.getRecordResult", {"roomId" : roomId,"gameType" : gameType,"expect" : expect}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      var getExpectList = function(roomId,gameType) {
          pomelo.request("connector.statistics.getExpectList", {"roomId" : roomId,"gameType" : gameType}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      var getCurBetting = function(roomId) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "getCurBetting","roomId" : roomId}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      var superOperation = function(cmd,roomId,uid,data) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : cmd || "getBalconyList","gameType" : "CPGame","uid" : uid,"roomId" : roomId,"data" : data}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      //管理员改变代理积分
      var changeAgencyScore = function(roomId,score) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "changeAgencyScore","roomId" : roomId,
            "score" : score}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      //管理员查询代理积分
      var getAgencyScore = function(roomId) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "getAgencyScore","roomId" : roomId}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      //设置股东
      var setStockUid = function(roomId,uid) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "setStockUid","uid" : uid,"roomId" : roomId}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      //管理员获取股东吃货信息
      var getStockWaterInfo = function(roomId) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "getStockWaterInfo","roomId" : roomId}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      //管理员设置股东吃货比例
      var setStockWaterPercent = function(roomId,value) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "superOperation","params" : {"cmd" : "setStockWaterPercent","roomId" : roomId,"value" : value}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      //股东获取股东所属房间列表
      var stockGetStockRoomList = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "stockOperation","params" : {"cmd" : "getStockRoomList"}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      //股东获取自身积分改变记录
      var stockGetStockScoreRecord = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "stockOperation","params" : {"cmd" : "getStockScoreRecord"}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      //股东获取自身积分
      var stockGetStockScore = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "stockOperation","params" : {"cmd" : "getStockScore"}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      //股东给代理加分
      var stockChangeAgencyScore = function(roomId,score) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "stockOperation","params" : {"cmd" : "changeAgencyScore","roomId" : roomId,"score" : score}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      //股东获取代理积分
      var stockGetAgencyScore = function(roomId) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "stockOperation","params" : {"cmd" : "getAgencyScore","roomId" : roomId}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      //股东设置吃货值
      var stockSetStockWater =function(roomId,value) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "stockOperation","params" : {"cmd" : "getStockRoomList","roomId" : roomId,"value" : value}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      //股东获取股东吃货信息
      var stockGetStockWaterInfo = function(roomId) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "stockOperation","params" : {"cmd" : "getStockWaterInfo","roomId" : roomId}}, function(data) {
              console.log("flag is : ")
              console.log(data)
            }
          )
      }
      //下注
      var sendBet = function(bet,data) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "bet","params" : {"gameType" : "CQSSC_GAME"
            ,"type" : "baoJiangBet","code" : 0,"value" : data,"bet" : bet || 10,"repeat" : 0,"brother" : 0}}, function(data) {
              console.log("flag is : "+data.flag)
            }
          );
      }
      //撤销下注
      var repealBet = function(gameType,id) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "repealBet","params" : {"gameType" : gameType || "BJK3_GAME","id" : id}}, function(data) {
              console.log(data)
            }
          )
      }
      //获取房间记录
      var getLotterListing = function(bet,code) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "getLotterListing","params" : {}}, function(data) {
              console.log(data)
            }
          );
      }
      var getBankerLotterListing = function(bet,code) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "houseOwnerCmd","params" : {"code" : "getLotterListing"}}, function(data) {
              console.log(data)
            }
          );
      }      
      //获取积分记录
      var getScoreRecord = function(bet,code) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "getScoreRecord","params" : {}}, function(data) {
              console.log(data)
            }
          );
      }
      //获取下注记录
      var getUserBetRecords = function(bet,code) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "getUserBetRecords","params" : {}}, function(data) {
              console.log(data)
            }
          );
      }
      //获取赔率与下注限制
      var getAwardAndLimit = function(bet,code) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "getAwardAndLimit","params" : {"type" : "BJK3_GAME"}}, function(data) {
              console.log(data)
            }
          );
      }
      var join = function(roomId) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "join","params" : {"roomId" : roomId}}, function(data) {
              console.log("flag is : "+data.flag)
            }
          );
      }
      var robBanker = function(num) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "useCmd","params" : {"cmd" : "robBanker","num" : num}}, function(data) {
              console.log("flag is : "+data.flag)
            }
          );
      }
      var mbet = function(bet) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "useCmd","params" : {"cmd" : "bet","bet" : bet}}, function(data) {
              console.log("flag is : "+data.flag)
            }
          );
      }
      var allIn = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "useCmd","params" : {"cmd" : "allIn"}}, function(data) {
              console.log("flag is : "+data.flag)
            }
          );
      }
      var sendGiveUp = function(bet) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "useCmd","params" : {"cmd" : "giveUp"}}, function(data) {
              console.log("flag is : "+data.flag)
            }
          );
      }
      var compare = function(target) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "useCmd","params" : {"cmd" : "compare","target" : target}}, function(data) {
              console.log("flag is : "+data.flag)
            }
          );
      }
      var compare = function(target) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "useCmd","params" : {"cmd" : "compare","target" : target}}, function(data) {
              console.log("flag is : "+data.flag)
            }
          );
      }
      var newRoom = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "newRoom","params" : {gameType : "werewolf"}}, function(data) {
              console.log(data)
            }
          );
      }
      var answer = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "newRoom","params" : {gameType : "answer"}}, function(data) {
              console.log(data)
            }
          );
      }
      var zhajinniu = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "newRoom","params" : {gameMode : 4,
            consumeMode: 1,gameNumber: 10,bankerMode : 1,cardMode : 1,playerAmount: 6,basic : 1,gameType : "zhajinniu"}}, function(data) {
              console.log("flag is : "+data.flag)
            }
          );
      }
      var agency = function(argument) {
          pomelo.request("connector.entryHandler.sendData", {"code" : "agency","params" : {gameMode : 4,
            consumeMode: 1,gameNumber: 10,bankerMode : 1,cardMode : 1,playerAmount: 6,basic : 1 ,gameType : "zhajinniu"}}, function(data,msg) {
              console.log("flag is : "+data.flag)
              console.log(data.msg)
            }
          );
      }
      var login = function(uid) {
        pomelo.init({
          host: host,
          port: port,
          log: true
        }, function() {
          pomelo.request("connector.entryHandler.enter", {"uid" : uid}, function(data) {

          });
        });          
      }
      var vlogin = function(uid) {
        queryEntry(uid,function(host, port) {
          pomelo.init({
            host: host,
            port: port,
            log: true
          }, function() {
            var route = "connector.entryHandler.visitorEnter";
            pomelo.request(route,{"uid" : uid,inviter : 10001}, function(data) {
              console.log("!!!!!")
              console.log(data)
              if(data.error) {
                console.log(data)
                return;
              }
            });
          });
        });
      }
      var tokenLogin = function(unionid,token) {
        queryEntry(0,function(host, port) {
          pomelo.init({
            host: host,
            port: port,
            log: true
          }, function() {
            var route = "connector.entryHandler.tokenLogin";
            pomelo.request(route,{"unionid" : unionid,"token" : token}, function(data) {
              console.log(data)
              if(data.error) {
                console.log(data)
                return;
              }
            });
          });
        });  
      }
      // query connector
      var queryEntry = function(uid,callback) {
        var route = 'gate.gateHandler.queryClientEntry';
        pomelo.init({
          host: host,
          port: "3910",
          log: true
        }, function(data) {
          console.log("!!!!!")
          console.log(data)
          pomelo.request(route, {
            uid: uid
          }, function(data) {
            console.log("11data !!!!")
            console.log(data)
            pomelo.disconnect();
            if(data.code === 500) {
              console.log(data)
              return;
            }
            callback(host, data.port);
          });
        });
      };
      var test = function() {
          pomelo.request("connector.entryHandler.test",null,null);
      }
      var quit = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "userQuit"}, function(data) {
              console.log("flag is : "+data.flag)
            }
          )
      }
      var giveDiamond = function(target,diamond) {
          pomelo.request("monitor.handle.giveDiamond", {target : target,diamond : diamond}, function(data) {
              console.log(data)
          })
      }
      var queryNickName = function(uid) {
          pomelo.request("monitor.handle.queryNickName", {uid : uid}, function(data) {
              console.log(data)
          })
      }
      var getUsers = function() {
          pomelo.request("connector.monitor.onlineUser",null, function(data) {
              console.log(data)
          })
      }
      var getRooms = function() {
          pomelo.request("connector.monitor.roomInfos",null, function(data) {
              console.log(data)
          })      
      }
      var getAgencyList = function() {
          pomelo.request("connector.monitor.getAgencyList",null, function(data) {
              console.log(data)
          })      
      }
      //=================================================================抽奖============================================================/
      //抽奖
      var lottery = function() {
          pomelo.request("connector.award.lottery", {}, function(data) {
              console.log(data)
            }
          )
      }
      //添加机器人数据
      var addRobotLottery = function(index) {
          pomelo.request("connector.award.addRobotLottery", {"index" : index}, function(data) {
              console.log(data)
            }
          )
      }
      //自动机器人
      var setRobotState = function(state,table,time) {
          pomelo.request("connector.award.setRobotState", {"state" : state,"table" : table,"time" : time}, function(data) {
            }
          )
      }
      //设置库存表
      var setLotteryInventoryItem = function(data) {
          //itemId value
          pomelo.request("connector.award.setLotteryInventoryItem", {"data" : data}, function(data) {
              console.log(data)
            }
          )
      }
      //设置转盘表
      var setLotteryTable = function(data) {
          pomelo.request("connector.award.setLotteryTable", {"data" : data}, function(data) {
              console.log(data)
            }
          )
      }
      //设置物品状态 0 : 未发送   10:已发送完成
      var sendAwardState = function(uid,orderNumber,state) {
          pomelo.request("connector.award.sendAwardState", {"uid" : uid,"orderNumber" : orderNumber,"state" : state}, function(data) {
              console.log(data)
            }
          )
      }
      //获取抽奖次数列表
      var getLotteryCountList = function() {
          pomelo.request("connector.award.getLotteryCountList", {}, function(data) {
              console.log(data)
            }
          )
      }
      //添加抽奖次数(仅管理员)
      var addLotteryCount = function(uid,count) {
          pomelo.request("connector.award.addLotteryCount", {"uid" : uid,"count" : count}, function(data) {
              console.log(data)
            }
          )
      }
      //获取重要物品抽奖记录
      var getImportanceAwardList = function() {
          pomelo.request("connector.award.getImportanceAwardList", {}, function(data) {
              console.log(data)
            }
          )
      }
      //获取我的奖励背包
      var getMyLotteryAward = function() {
          pomelo.request("connector.award.getMyLotteryAward", {}, function(data) {
              console.log(data)
            }
          )
      }

      //获取奖品表（转盘内容）
      var getLotteryTable = function(a) {
          pomelo.request("connector.award.getLotteryTable", {}, function(data) {
              console.log(data)
              a = data
            }
          )
      }
      //获取奖品库存（仅管理员）
      var getLotteryInventory = function(a) {
          pomelo.request("connector.award.getLotteryInventory", {}, function(data) {
              console.log(data)
              a = data
            }
          )
      }
      //获取已获奖记录(仅管理员)
      var getLotteryAwardList = function() {
          pomelo.request("connector.award.getLotteryAwardList", {}, function(data) {
              console.log(data)
            }
          )
      }
      //获取抽奖记录(仅管理员)
      var getLotteryHistory = function() {
          pomelo.request("connector.award.getLotteryHistory", {}, function(data) {
              console.log(data)
            }
          )
      }
      //获取我的抽奖次数
      var getLotteryCount = function() {
          pomelo.request("connector.award.getLotteryCount", {}, function(data) {
              console.log(data)
            }
          )
      }

      //=================================================================抽奖============================================================/
      var init = function() {
        pomelo.init({
          host: host,
          port: port,
          log: true
        }, function() {
        })
      }

      var finishRoom = function(roomId) {
          pomelo.request("connector.monitor.finishRoom",{"roomId" : roomId}, function(data) {
              console.log(data)
          })
      }

      var finishAllRoom = function() {
          pomelo.request("connector.monitor.finishAllRoom",null, function(data) {
              console.log(data)
          })
      }

      var getAgencyRoom = function() {
          pomelo.request("connector.entryHandler.getAgencyRoom",null, function(data) {
              console.log(data)
          }); 
      }

      var mroom = function() {
          pomelo.request("connector.entryHandler.sendData", {"code" : "newRoom","params" : {
            consumeMode: 1,gameNumber: 10,cardMode : 1,basic : 1,gameType : "mingpaiqz"}}, function(data) {
              console.log("flag is : "+data.flag)
            }
          );
      }
      var getTick = function() {
          pomelo.request("connector.entryHandler.getTicket",null, function(data) {
              console.log(data)
          });
      }
    </script>
  </head>
  <body>
    <div class="g-doc">
      <div class="g-banner" style="border:none">
        <div class="logo">
          <div class="img"></div>
        </div>
      </div>
      <div class="g-background">
        <div class="g-content">
          Welcome to Pomelo
        </div>
      </div>
      <div class="g-link">
        Home:
        <a href="https://github.com/NetEase/pomelo">https://github.com/NetEase/pomelo</a>
      </div>
      <div class="g-button">
        <input id="test" type="button" value="Test Game Server" onclick="show()"/>
      </div>
    </div>
  </body>
</html>
